package com.test.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

import com.test.proxy.Animal;
import com.test.proxy.Cat;

public class ProxyApp {

	public static void main(String[] args) {
		Animal cat = new Cat();
		InvocationHandler handler = new AnimalInvocationHandler(cat);
		Animal animal = (Animal) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {Animal.class}, handler);
		animal.say();
	}

}
